package com.hedl.classroom.service.impl;

import com.hedl.classroom.service.CheckCodeService;
import org.springframework.stereotype.Component;

import java.util.UUID;

/**
 * @author Big Watermelon
 * @description uuid生成器
 * @date 2023/12/10/15:18
 */
@Component("UUIDKeyGenerator")
public class UUIDKeyGenerator implements CheckCodeService.KeyGenerator {

    @Override
    public String generate(String prefix) {
        String uuid = UUID.randomUUID().toString();
        return prefix + uuid.replaceAll("-","");
    }
}
